<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/jsp/common.jsp"%>
<table
	class="am-table am-table-bordered am-table-striped am-table-hover am-table-centered">
	<thead>
		<tr>
			<th width="50px">序号</th>
			<th>报送事项</th>
			<th>技术成果名称</th>
			<th>报送人</th>
			<th>所属单位</th>
			<th width="120px">最后上报时间</th>
			<th width="100px">审核状态</th>
			<th width="210px">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${page.records }" var="file" varStatus="status">
			<fmt:formatDate value="${file.czsj}"
				pattern="yyyy-MM-dd HH:mm:ss" var="updateTime" />
			<tr class="select">
				<td>${status.index + 1}</td>
				<td><a href="javascript:usercont.detail('${file.sqlId }');">${file.submission}</a></td>
				<td>${file.title }</td>
				<td>${file.userId }</td>
				<td>${file.unit }</td>
				<td>
					<c:forTokens items="${updateTime }" delims=" " var="time">
						<c:out value="${time}"/><br/>
					</c:forTokens>
				</td>
				<td>
					<c:choose>
						<c:when test="${file.shzt eq 'W' or file.shzt eq 'w'}">
							待审核
						</c:when>
						<c:when test="${file.shzt eq 'Y' or file.shzt eq 'y'}">
							审核通过
						</c:when>
						<c:when test="${file.shzt eq 'N' or file.shzt eq 'n'}">
							审核不通过
						</c:when>
						<c:otherwise>
							待审核
						</c:otherwise>
					</c:choose>
				</td>
				<td>
					<div class="am-btn-group am-btn-group-xs">
					<c:if test="${(file.shzt ne 'Y' and file.shzt ne 'y') and (file.shzt ne 'N' and file.shzt ne 'n')}">
						<button class="am-btn am-btn-default am-btn-xs am-text-success"
							onclick="usercont.tg('${file.sqlId }')">
							<span class="am-icon-eye"></span> 审核通过
						</button>
						<button class="am-btn am-btn-default am-btn-xs am-text-success"
							onclick="usercont.btg('${file.sqlId }')">
							<span class="am-icon-eye"></span> 审核不通过
						</button>
					</c:if>
					
					<c:if test="${file.finalRejection eq ('@#'.concat(userinfo.seqId))}">
						<button class="am-btn am-btn-default am-btn-xs am-text-success"
							onclick="usercont.edit('${file.sqlId }')">
							<span class="am-icon-eye"></span> 修改
						</button>
						
						<button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"
							onclick="usercont.del('${file.sqlId }')">
							<span class="am-icon-eye"></span> 删除
						</button>
					</c:if>
					</div>
				</td>
			</tr>
		</c:forEach>
	</tbody>
</table>
<%@ include file="/WEB-INF/jsp/manage/page.jsp"%>

<script>
	var flag = "${flag}";
	
	if(flag == "DM_ER"){
		layer.msg("处理审核结果时遇到错误！", {icon: 2});
	}
	else if(flag == "FR_NP"){
		layer.msg("更新失败！审核不通过原因不能为空", {icon: 2});
	}
	else if(flag == "FR_TL"){
		layer.msg("更新失败！审核不通过原因太长，不能超过255个字符", {icon: 2});
	}
	else if(flag == "FG_NP"){
		layer.msg("审核操作结果只能为通过或者不通过！", {icon: 2});
	}
</script>